设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14286|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 a4 U5 p- {' B* m3 \9 @1 u7 e' D  ^" W, W8 e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  V2 K' r2 T8 m* d- Z% z
% ~5 W8 y( A- U3 cbegin P_read arriving! u4 F3 J0 {$ C' l( M# n9 R
    while 1=1 do begin
* D- W" |$ Y, ?. Y5 B8 ~6 f+ e+ A        read A_tote from "data.txt" with delimiter "\n"6 }2 @* g1 `6 {' A
        read A_time from "data.txt" with delimiter "\n"
: _. H; M* k) G) Y" @        read A_leave from "data.txt" with delimiter "\n"
/ z9 a+ j- @# x        read A_picks from "data.txt" with delimiter "\n"# _( n* P( y; U, J* L  [3 E% G
        set load type to A_tote
! Y' g& ^, _# ?0 o" o, X        if A_tote="tote 1" then set A_induct to 14 @" N6 H$ j& H! J3 I
        else if A_tote="tote 2" then set A_induct to 2
- J8 V$ `& s+ d1 v/ _) h            else set A_induct to 3   
: U! i" J& |8 D+ A% c( T  l        set A_i to 01 Y7 S" g/ D0 B& `- G
        clone 1 load to P_induction7 o0 o4 g2 M; n3 O
        wait for A_time sec- k8 Q( q4 U0 I" I+ a
    end
- ?$ a8 r2 s7 kend0 ~. ]/ o8 `! P

0 X5 u! A# z$ S* v" Ebegin P_induction arriving
9 {' h, w! r  c3 z3 y: V  |/ m8 D    if A_induct=1 then clone 1 load to P_pick13 x( I; N! t' h' L
    else if A_induct=2 then clone 1 load to P_pick2( d! ~7 {. k& r; L$ [
        else clone 1 load to P_pick3
1 E# j( O( P7 `4 Q+ f7 v+ Lend
0 C4 }0 _- ]5 |3 N, p3 _, U9 Y! z8 T# ~. P6 m- D! {! y
begin P_pick1 arriving, ]! ^8 v* l1 {# Q1 q5 e! w
    set A_i to 1
8 |6 E3 o, l  P% v$ H' m    move into Q_induct1' B9 T- g4 V% C
    move into pickaisle.induct1
1 c1 ~, V) c. Y' Q1 V2 M    while A_i<=30 do begin* J: l% J, r+ L; E, U# {
        travel to pickaisle.con(A_i)
1 s/ E( _9 n- I1 }( |8 r$ I/ c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 E( W4 L4 c2 h: B3 l1 [3 q2 v        else wait for 10 sec$ y: c4 o+ Z, G; g& y+ \) c% U5 j
        if A_i=A_leave then send to die
* [5 W4 X! m# R, j1 O: P% p6 Q        else inc A_i by 11 c3 i8 S) F" [/ ^
    end1 K% C9 P6 s- c: y6 i: [3 Y
end
  G* p4 N2 h2 A! F( @/ ?6 z
* l# _: k$ N2 o3 @) \4 J2 X3 Ubegin P_pick2 arriving5 N- d: u8 P; A, P$ t2 W2 j
    set A_i to 11
8 U! r" t1 C$ F" ^    move into Q_induct2  ]6 K% D& ~2 F/ ]1 T5 u
    move into pickaisle.induct2- x# Z+ ^- d8 h
    while A_i<=30 do begin
+ G/ D* S  v6 X0 n: ?% o        travel to pickaisle.con(A_i). m) ^% U5 \1 t5 h9 r* @* j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 S2 y$ [% {6 y" E  i
        else wait for 10 sec/ [' E1 {" R2 _4 I" Q) M: O; d
        if A_i=A_leave then send to die
, V1 ]; i* E; q3 ?  r        else inc A_i by 1
4 A6 Q: |/ Z8 r( g$ W    end
/ c+ [, q. B* r1 Mend
0 R0 B0 @. D4 ?
% f5 t6 M  z3 \+ J! K9 D! F, O; l2 ubegin P_pick3 arriving1 K) ^5 n; A) c
    set A_i to 21. M* H. Y% w3 S- Y2 I- R$ ]5 v
    move into Q_induct3% \$ Y" h! p# m7 P# B
    move into pickaisle.induct3  E; X/ s0 h" w/ Z1 \
    while A_i<=30 do begin. O, g" w6 Y$ L
        travel to pickaisle.con(A_i)
/ t' E0 `9 C4 N( F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 S( Q$ U9 ?9 c/ c2 D9 @  W4 G        else wait for 10 sec
7 r( V, r6 \% {7 `; S2 g9 p. V        if A_i=A_leave then send to die
# A+ o6 \( ]* @# }  ?( P7 s1 ^6 C+ i5 U        else inc A_i by 1
- I( l" D1 _& W- {: e; G* h    end
* c/ \" G% Y" A7 `4 M) m3 U- H9 Fend

最佳答案

查看完整内容

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是个什么东东?- d* B9 X/ ?$ ]1 S4 Z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& }2 w+ H' Y" `' u( p: l

0 E  p; A3 G" M  z- o3 k: VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; l% r& }) c6 d/ S6 \2 A
! W3 l' j) z" Z7 D6 s0 V% K8 Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& K* C- r! B$ Q4 T
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. P6 T- C5 D" [4 N" q- |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, M9 t9 O" v: q: S9 G9 z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 \, A! `. ^; k4 ^# v
begin P_induction arriving
% L0 ]/ A( E6 C  J    clone 1 load to P_pick(A_induct)
( b# d1 |' a$ Q+ _end最大的系
) j: }$ D1 i2 H: |1 D: u" n# K1 ^) W
9 q5 X* Y; w& g, q8 w& i2 Y- V! `begin P_pick arriving6 i4 L4 C) ^' Z
    set A_i to procindex * 10 + 1
- S( n: {& q$ j" O    move into Q_induct(procindex)
4 x1 p8 ?# A  T" s& f0 W& u    move into pickaisle.induct(procindex)* S  U) Q& [% r/ n7 O
    /*check the type of pickaisle.induct(i), for your last problem.*/
! W; I* b6 C# |5 C+ v9 k0 [/ F0 V  a
8 x2 u5 ]+ N1 u% c6 ?( o# E    while A_i<=30 do begin
2 E- N7 ~" q4 m        travel to pickaisle.con(A_i)) }% Z0 g, R. z" }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; V& Z, O0 v) ^5 u4 C8 d) m        else wait for 10 sec
2 ^0 `6 m3 n7 ~        if A_i=A_leave then send to die- G/ F  t+ g0 V
        else inc A_i by 1
# Y  e+ a7 V  x0 G; Z    end
% l! I1 m3 Y9 L) aend% `* N8 I' g: h6 V* l

7 ~2 |2 t. _( O- \8 G其中的procindex为整形,代表当前process的序号。& A: d% p, A0 W/ M" q
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-28 07:49 , Processed in 0.013883 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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