设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13996|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 Q- o' T* I: G
# T, \6 `9 |& l3 s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( C% ~, D' B  F( l: e/ M* Y6 T' z$ b" M5 t& R; q
begin P_read arriving
- J& e! B- u6 q" W5 n: I0 k" U. D    while 1=1 do begin- s9 G" G2 |5 \. H6 b4 J' g
        read A_tote from "data.txt" with delimiter "\n"# i" V, E$ x+ {. x- c; R
        read A_time from "data.txt" with delimiter "\n") B3 u8 X4 ~) C  z
        read A_leave from "data.txt" with delimiter "\n"
: s! B) R/ h6 P7 E$ ~0 \  ^        read A_picks from "data.txt" with delimiter "\n"
( |9 R- C. p% O        set load type to A_tote, {( R- j! ?3 N' M5 T
        if A_tote="tote 1" then set A_induct to 1$ K7 V$ c1 |- l, n
        else if A_tote="tote 2" then set A_induct to 2" }: ^8 }) i; O' ?
            else set A_induct to 3    8 w7 S' y/ W: g, z4 Q$ N" M
        set A_i to 0
! E: B, G; ]  \( x        clone 1 load to P_induction$ C  C% G$ i- D! i. L
        wait for A_time sec
+ z3 e$ P5 L' j# g0 ^0 p! P, L; }    end
% \) e, ?2 E0 c3 vend
8 z% F; x1 y! T* f: \
! d, h: k7 F: J0 |' a4 o  [$ f0 }begin P_induction arriving7 B- y; N7 I9 g* b- a
    if A_induct=1 then clone 1 load to P_pick1; _( j% |1 p& m
    else if A_induct=2 then clone 1 load to P_pick2
4 l+ h" r4 t1 n% O% |        else clone 1 load to P_pick3
. O" {( d! N" h) L5 M, aend4 d# y- ]6 g# `! M* m
$ O+ h/ k, M4 M3 H7 ]: S
begin P_pick1 arriving
. @- {4 z9 W- ~8 j( f    set A_i to 1
4 R! ?! C! G& \- x& E    move into Q_induct1+ @+ ], K2 i6 _
    move into pickaisle.induct1
% G' E3 K5 s5 }2 O) C7 W: [    while A_i<=30 do begin
# A; a$ S' W% @. i, ?0 f        travel to pickaisle.con(A_i)" l' ?) J; B5 q# ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 L! l& ~# j" V# w  K0 |( t3 O* K        else wait for 10 sec% `% i) O9 @3 b4 m
        if A_i=A_leave then send to die; E7 B$ G( P* H. T
        else inc A_i by 1  ^" C5 U8 u; k* @# S: V+ L
    end7 P* o6 L* k+ b# x3 J5 a6 x
end8 S/ c( ^/ j, N

0 [) I' Y5 u  L+ B' g$ V  `begin P_pick2 arriving
; K/ q6 N, l' I4 m    set A_i to 11
. S* L% v& A# A5 O) ]" _    move into Q_induct22 N5 H; ]* i9 q. W( @4 R5 T
    move into pickaisle.induct2
( B1 j4 ^: ?5 }3 J! o/ ]    while A_i<=30 do begin; N1 t2 B! T, e+ G2 _% k7 _
        travel to pickaisle.con(A_i)
% Y: p* z+ C4 b* i3 b* _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ b, N& H" c' |, g+ v        else wait for 10 sec
+ ~7 S( b1 _- ]" U1 }        if A_i=A_leave then send to die
( x( @3 ~) W2 i) g4 j5 d; H2 n        else inc A_i by 1
6 s8 \1 y) s# Q4 L( g+ L( j% q    end
( c# V+ I% N/ _- D: M2 ]end4 R4 |, I/ @) }  ?' \) L5 y

- k' X7 k5 c* |4 ^& e" e. Pbegin P_pick3 arriving4 L& m2 J! x" y$ `( f9 l5 K* K
    set A_i to 21
) _9 J# i6 H) u    move into Q_induct3
( g/ J  R3 Y7 E' ^9 }4 f& K0 B    move into pickaisle.induct3- d4 }' z% z, X4 a1 S" G* |+ u5 @7 o
    while A_i<=30 do begin2 v7 `2 ^4 S# Z* g! S( f
        travel to pickaisle.con(A_i)
' F8 J) I1 E! a! j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' j! o, ?$ Y1 o        else wait for 10 sec
  ~; r4 b6 n1 w# y3 E        if A_i=A_leave then send to die
& A2 ^0 @* _; x0 N        else inc A_i by 1
3 N! Q4 o6 l, d- a    end
; `, O! s1 A8 _! ~7 X9 a" ~8 j0 pend

最佳答案

查看完整内容

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是个什么东东?
7 @3 G9 q2 Z3 f/ d0 k$ y5 D2 U5 Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( m" Q$ o, N' X6 l/ B0 \
2 e% j' M* }( t) J. Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- p" [5 i. t. U; z& k0 s
* l1 i/ i% V" a) X# x6 w( U
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* o5 X0 f' H% C8 b. k" `( a1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 |" Y, y; A/ [  ^+ y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 ?  i( b/ _! U7 K  ^5 q  D2 ~' N6 i
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 Y) N- b/ g* X4 O' n, U2 c+ K% `- u
begin P_induction arriving
7 L) Y+ b7 }& D! ?    clone 1 load to P_pick(A_induct)
0 g3 _# J8 c* U5 }/ h  {8 S$ dend最大的系3 ~8 X" F( g, M- F# N0 u3 g/ y

! E0 L# U# p. J$ A8 Kbegin P_pick arriving
( s: z- D1 ~! P% ?/ ?    set A_i to procindex * 10 + 1
% K) m. v) ~& e: T    move into Q_induct(procindex)
& H% ]; n; s+ i+ j6 B    move into pickaisle.induct(procindex)9 Y- @% V0 R8 L/ v3 G" [
    /*check the type of pickaisle.induct(i), for your last problem.*/- g# ^; ?: d) \3 i
& K" t5 z- ^* ?1 o
    while A_i<=30 do begin
4 d" W4 e: T& e* `/ S        travel to pickaisle.con(A_i)
3 d4 Y( s; d6 ~  f. ~  Z/ B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 w+ I" N! }- Q+ h* v% X
        else wait for 10 sec
  e2 c* L& @4 i        if A_i=A_leave then send to die( n. s4 _* ~/ d7 X( c
        else inc A_i by 1
% p( w1 r. u( o+ V2 s' N    end' w; d# a0 e% m
end
3 i4 |9 ~2 ~5 i" ^8 M# W& v  ~2 U! N- D" c0 B
其中的procindex为整形,代表当前process的序号。
3 v6 H- m* H- g! Qstation和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-5-28 08:20 , Processed in 0.015323 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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