设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14229|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  l3 D0 Z* M1 U/ `4 A
  G% g/ D! \) h/ O; l
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
/ g1 F/ ^4 |4 f! \4 ^# ?; a
" S. g+ Z, A) h' N  s+ I" X) v1 Kbegin P_read arriving$ T5 }4 r3 V, ^4 S: N3 O
    while 1=1 do begin$ ^! E* x* h  W; Z
        read A_tote from "data.txt" with delimiter "\n"
; P& X, P* G# t# b+ e2 A$ f        read A_time from "data.txt" with delimiter "\n"
% l$ P) B0 Z3 b$ t        read A_leave from "data.txt" with delimiter "\n"0 c) ]& h" _1 o9 O: j
        read A_picks from "data.txt" with delimiter "\n"+ Y9 M2 Y, T$ Q+ A; a/ j  e/ f
        set load type to A_tote
1 Q) @9 l6 A$ T; A% W9 U4 Y' G        if A_tote="tote 1" then set A_induct to 1
8 s. W* R* X; }' _/ e        else if A_tote="tote 2" then set A_induct to 2
# `( B0 p) W* x1 r# V" \& @: S            else set A_induct to 3   
, @/ a$ L& `- ~' Q: \9 |        set A_i to 0; t) G3 l) N) f- a
        clone 1 load to P_induction
0 g! {1 e- `7 J4 k' ?- I( v        wait for A_time sec9 j0 v: z7 Y* R4 L
    end' j" c7 ?) v8 t$ n' l- k4 Q$ D
end: [  ^* y& z, q' {+ s' f0 }( s
# ~6 r" Y9 b$ X0 ]( X. u5 Z% v2 `
begin P_induction arriving) j: i& k  v: \' A
    if A_induct=1 then clone 1 load to P_pick1
$ f) R- `" M3 d' r    else if A_induct=2 then clone 1 load to P_pick2
8 N2 w! B4 f3 ]7 W7 Z3 F        else clone 1 load to P_pick3% M1 c  ^7 n0 ]
end
6 K4 n2 z) s0 b; |, g9 {* z& i& t' B6 @! j5 J! E
begin P_pick1 arriving
  c. x$ z8 g9 y6 Z. y' [    set A_i to 1/ u1 m/ @, r$ M( v
    move into Q_induct1
8 h2 {# {9 Y' i# y6 |5 U    move into pickaisle.induct12 K5 S5 a+ g% c% y6 e
    while A_i<=30 do begin
$ B/ e7 m; T  }6 T        travel to pickaisle.con(A_i)
6 S" a" e; i; I$ z" {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ N, s; ~$ V( Q$ V* O' {
        else wait for 10 sec
- A% l! i: b8 R& F; |) V        if A_i=A_leave then send to die& l# Z9 M) t0 k( {' y0 O: Z( e
        else inc A_i by 1' n+ i' Y; x: [. s" k) [+ G
    end
, l0 J6 H  ?0 i: g  f; d3 jend: a' t& o: j( S; a
8 X' M8 A5 n* C  O
begin P_pick2 arriving
' _2 C; @4 e, U* ]    set A_i to 116 r5 ^2 X' M, B* [9 H4 E) u) |
    move into Q_induct2
5 _! \; o7 l' {/ y) Y: A$ Y    move into pickaisle.induct2
) `( I" [' n" I, I6 g2 k- X* Y    while A_i<=30 do begin& e5 |3 I7 t8 \* ?) ^; j
        travel to pickaisle.con(A_i)
8 ?1 o4 U- w0 |" w( y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ?2 s# A( g# D( g6 z; \
        else wait for 10 sec
, e7 K8 r1 j# ^0 H# q! [5 j        if A_i=A_leave then send to die
( T5 i$ @. g# \4 B- }        else inc A_i by 1: [8 @9 k9 _+ O4 X! h
    end+ u6 `9 q/ B+ a3 y
end2 E, S. B5 H- q: J$ a0 D4 |. z

  z: o2 P' a+ F! [: ]begin P_pick3 arriving
7 T6 f! _4 A7 u* K    set A_i to 219 P+ l4 O7 \, k
    move into Q_induct3
( w- I  E( `) \, c2 {3 n    move into pickaisle.induct3. P/ {& M. Y+ X+ G% i
    while A_i<=30 do begin
* z6 _' l3 j7 @+ h3 r: {. Y        travel to pickaisle.con(A_i)
2 ?# N3 M& Q3 ~+ O. {+ C3 `! N" D$ I9 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( E8 ^7 H$ a  t. x2 Y9 _        else wait for 10 sec, ~: y1 N! y( q" q" r' N2 b
        if A_i=A_leave then send to die  m2 q" X9 I, b! R4 L
        else inc A_i by 1
, O* A: B# S' ?2 b' ?- A# L    end
$ r+ m1 Y' H) P6 _end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?$ r, {$ l9 ?6 C5 E. g  b! [* w  B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ o9 w1 [4 a5 q5 I) R& n
: Z/ [3 U/ z6 ]9 }( \8 s0 jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( h+ \! O) _) e8 {+ y0 J8 @
- b/ n/ Q2 X' z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 @/ q& P3 T1 p' e3 G5 Q; _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 [9 Y6 N% E7 y) J& B) _2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& B& H7 S  n$ q9 n! A  L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* J  Q4 |4 S1 r9 M
begin P_induction arriving4 u' ~0 O& C/ `4 I, q3 u( C7 A
    clone 1 load to P_pick(A_induct)
" b! V/ |& y# F8 [3 bend最大的系/ o7 d/ M# |  X* Q% o! s8 e+ p
+ W  F0 q* [! d3 g
begin P_pick arriving
8 V7 G0 c4 ~+ j( M( ?    set A_i to procindex * 10 + 11 o3 S2 t/ r  \5 N- @/ h4 n
    move into Q_induct(procindex)  ?) e0 j& l! ^% o
    move into pickaisle.induct(procindex); v. w$ ?1 L, Y$ s
    /*check the type of pickaisle.induct(i), for your last problem.*/
1 l2 i+ e7 d$ H7 {  `/ \" {9 d/ Y. i7 {* c( f  O
    while A_i<=30 do begin. u- Z& g) u0 `2 ?  N6 p
        travel to pickaisle.con(A_i)* p/ V; e& `+ `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* @2 N& D8 N, }- W6 M        else wait for 10 sec
- J  R: `: A% l! h1 X        if A_i=A_leave then send to die: m; k: A$ {( q5 Y) i7 d
        else inc A_i by 1
$ r' v# i7 |2 j% B+ c! H6 O    end' k+ ]9 L) ~* ^6 h' x
end! |* j; R  B0 ~8 }* h! L# G

1 P7 A- H! P# I3 V. i% s0 I3 S其中的procindex为整形,代表当前process的序号。
* u1 b" {" F9 @! i1 {station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-6-22 23:04 , Processed in 0.012570 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表