设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15234|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- A( j" [' U. Y: k+ P3 G6 t5 i! T, V+ k1 ]  A
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ T6 H+ r" P9 y( v7 |! m
( \! Q3 ~' i% Y7 W
begin P_read arriving
* j3 e7 |7 \! b/ J/ w8 p    while 1=1 do begin
# r" P7 B3 X) u/ x+ A4 ~) C- C. q" A        read A_tote from "data.txt" with delimiter "\n"
) r' y) H: j6 w        read A_time from "data.txt" with delimiter "\n"+ q7 a4 e9 F$ U2 m
        read A_leave from "data.txt" with delimiter "\n"
( D9 c* a* B% D9 \0 b. C        read A_picks from "data.txt" with delimiter "\n"
/ {3 I2 F% w& g- V' k' U( N3 [! M8 t        set load type to A_tote& A- Z- V  ]' u6 C/ ]1 x
        if A_tote="tote 1" then set A_induct to 1+ \3 ^4 E/ U: q+ J. k
        else if A_tote="tote 2" then set A_induct to 2/ k# |% K, x" _' Q
            else set A_induct to 3    % G$ b/ d# c' j$ ^. Q3 n* W9 f
        set A_i to 00 G% \4 R  W1 w# x1 b' h. U
        clone 1 load to P_induction
: q* i! c' W2 R/ N1 Q        wait for A_time sec, g- [4 l8 l6 Z3 a6 O  C" P+ q
    end% z0 k4 y0 D6 O' X% @
end" S# O/ {! y6 R1 K- k* T1 [

% a, n& m  `* {4 vbegin P_induction arriving
: C$ J% ]- A5 A* r! b6 X" P+ r    if A_induct=1 then clone 1 load to P_pick1
# S  H, a* D2 v0 A4 ]' U3 C    else if A_induct=2 then clone 1 load to P_pick29 y$ t/ X0 W1 u9 P; @4 u, ]
        else clone 1 load to P_pick34 L2 U/ E+ _& h, U5 D
end8 y4 W% U9 M: `4 K
( S1 S$ o2 N0 {  n
begin P_pick1 arriving$ t( @, i. \" m
    set A_i to 1
7 \# d! o+ l$ o: ]% b# L    move into Q_induct1% c- L; u* m# B0 X( u# u9 p; _  V
    move into pickaisle.induct1
# \7 h$ m4 P/ z3 Z    while A_i<=30 do begin' `, s  `5 U& }1 x
        travel to pickaisle.con(A_i)! r6 I0 N( g. Y5 |, ?1 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 j9 q. A3 H" J: ~
        else wait for 10 sec) o! e$ {# O' [% Q* F  J8 _1 y! \% E
        if A_i=A_leave then send to die
9 x) I9 ]# b7 ~8 G$ [. }        else inc A_i by 1* a  Q3 l/ _: ~. `7 j
    end& K* ^/ v9 m1 q6 L. n
end0 ^4 M/ `" q8 y5 t% d
5 m/ I  t7 I' d9 E
begin P_pick2 arriving- |3 P+ p+ f( |( R( Z
    set A_i to 116 h" \$ D/ E9 T
    move into Q_induct2, G2 U/ |& A/ C  u: b& `" Q
    move into pickaisle.induct2
$ I% o! B2 J2 R5 N; I    while A_i<=30 do begin
  p* g) Y4 I1 h4 T5 u        travel to pickaisle.con(A_i)
2 e( Q$ R8 o" t4 T! G3 U+ X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) Y( i( ?! @% K        else wait for 10 sec* }6 W# h9 H; Q) q( w
        if A_i=A_leave then send to die4 }! X- m+ @( q( r% E# [
        else inc A_i by 13 E. Q, S# G) V+ H( b+ |! ^
    end
6 J* U& w) A5 m4 y% L* Cend0 l* u2 [# m, o1 U( d
* Z% l* m7 j: B4 \# B
begin P_pick3 arriving7 C6 s8 h& H6 Z  U% \
    set A_i to 21! Z& W+ z6 a- U  r& `( [' W
    move into Q_induct3
0 }6 M4 _4 J" l2 n    move into pickaisle.induct3
  q0 }& e5 G) l+ D$ Z2 k& D5 m    while A_i<=30 do begin- s8 W3 s- g. |8 j, n5 A
        travel to pickaisle.con(A_i)
* V( Z* j* d; h7 v$ a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 W4 w! m# k- k+ X6 p) J" v! j        else wait for 10 sec; n( o' x) @: o3 q2 P7 z
        if A_i=A_leave then send to die
# E0 b% |0 U0 A8 s* _        else inc A_i by 1
1 r( D* k/ N% n. B& h4 Z    end9 V7 U3 F$ O. z9 p
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是个什么东东?
# d5 F. O4 ]$ B% w, j3 v( s9 _move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% R+ [  c0 V& @/ R. a/ F* u! R( g; @; i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  Y- B# {4 {' M8 I3 \0 S/ u' w, @2 ~% H, z& r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ f% q2 t0 @$ A3 }9 q; b! x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! [! S3 s+ B5 K. @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ Y  [1 f! B% K( M2 r7 }7 C/ E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 f: Q1 N6 d1 [: K" |/ T
begin P_induction arriving
: y8 N5 {! d; @6 D' v1 l    clone 1 load to P_pick(A_induct)0 j: W8 ]5 c' Z: A2 |
end最大的系
/ _; V7 X: C4 m) b+ t/ m6 Y7 G4 G; N1 g
begin P_pick arriving
1 O7 K2 c+ q0 W" h* K, J    set A_i to procindex * 10 + 1
4 \+ O% R4 ^/ H# S    move into Q_induct(procindex)
* y3 t7 R, ~- ~. c" Y! B    move into pickaisle.induct(procindex)
- C, Z. g, |4 u/ C- h, E* J' b    /*check the type of pickaisle.induct(i), for your last problem.*/# B; V  K- t8 j0 R- r

& w7 r8 G3 s8 h/ E    while A_i<=30 do begin
: K' ?1 `$ Y" }! v3 Y# x3 {        travel to pickaisle.con(A_i)
# p- ]( |5 x9 x. u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 E9 R; F! ]0 S) f4 D        else wait for 10 sec
& b# l8 e  @1 u/ J& e        if A_i=A_leave then send to die
; I3 z& [  w8 P5 t& F        else inc A_i by 1! i8 i4 u& y1 y  n8 F7 ~# X
    end& w1 y5 H( Q1 c4 O0 X
end
) V: P- Q7 C  ]9 F1 I  F
  W2 E; ]# |( p  x其中的procindex为整形,代表当前process的序号。$ e. r( B4 h# I
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-8-26 07:45 , Processed in 0.015741 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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