设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13185|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; g. Y/ g# o4 N/ G" p
( a2 d8 K/ @3 l- F* K7 g6 x我的问题是,在每个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中的数值,不知道会不会有什么不妥。. P. X. C+ \( I7 P: O
2 W7 L) u6 b2 }. V8 k
begin P_read arriving5 q/ p9 I" f1 h  ]
    while 1=1 do begin1 D/ R) b" _" d# l, y; L
        read A_tote from "data.txt" with delimiter "\n"5 W3 X- \5 I0 y! Q) ]. {
        read A_time from "data.txt" with delimiter "\n"0 i- e0 E& }& B8 j* v0 `) b4 U4 z
        read A_leave from "data.txt" with delimiter "\n"! r1 k! E1 k0 A& n, E
        read A_picks from "data.txt" with delimiter "\n"4 C( E* P9 h: L$ |: |2 [
        set load type to A_tote  S0 s: z( j* L, n1 [! ~
        if A_tote="tote 1" then set A_induct to 1' _4 P0 @' z, t9 k) `% M
        else if A_tote="tote 2" then set A_induct to 2
- Q0 g3 F: f: z$ W4 q" _7 E            else set A_induct to 3   
& R+ v8 c6 z" L4 |( k6 X        set A_i to 0
3 i; X2 `% ^1 x5 C+ c        clone 1 load to P_induction
2 A; x: E' l+ Z8 H        wait for A_time sec  ^( Z6 x! ~3 C& F6 k  O6 u  {
    end+ O$ Z" h* K3 {) N$ l
end
% `1 E3 C: ~  \4 e* p2 ^* |) n
9 T  }3 k$ P/ H3 p1 s# c' y5 a0 D  Ebegin P_induction arriving
! w0 A" X  I% ]; ~! n    if A_induct=1 then clone 1 load to P_pick1
! c$ u' J3 b: ]5 s% ~9 i    else if A_induct=2 then clone 1 load to P_pick2
, i! ]4 z' o3 U: U* z        else clone 1 load to P_pick3
  f! S$ E# p" f% Send( B5 e0 D4 }; \7 ?) P8 ]
5 v) N  M+ M( X* c
begin P_pick1 arriving8 N: V/ }; o: Z, F. r. g
    set A_i to 10 D/ k- o7 v8 U9 ?. Q
    move into Q_induct1; t2 y$ K3 N/ p% V' i+ l. k
    move into pickaisle.induct11 M: \3 M+ ], F# E2 x
    while A_i<=30 do begin
, W* I) r1 c5 ~% x% V        travel to pickaisle.con(A_i)6 K$ C) A7 w$ Y& w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- a) i% b, y+ W; N2 a
        else wait for 10 sec$ c) U  s& f* v$ R
        if A_i=A_leave then send to die
# t9 f8 i9 @2 i/ D% p4 A5 B0 ]. y        else inc A_i by 1
- _( _( H& p+ y7 R& n    end
8 W4 @. T8 E# D# U& A9 f! jend& J( ?" c8 @: O# F' O9 y
* W0 u6 J! {, Q7 o% r& q- Q9 }: }
begin P_pick2 arriving3 n0 G8 y0 c6 J% h7 A0 _
    set A_i to 11* j" R+ C1 }9 |# ]
    move into Q_induct2
: S4 k4 W5 B3 K2 w8 X    move into pickaisle.induct2
6 q& Q, V  q' W    while A_i<=30 do begin' O1 C* G& [& m# N) s) k$ R
        travel to pickaisle.con(A_i)% u  R& e% ?* D; G/ Q% Z9 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 b# V' V) f8 a7 Z
        else wait for 10 sec
6 Q0 E0 q5 h  X, q) k3 L  V        if A_i=A_leave then send to die
! ]: l6 Z) f4 Q1 S# V7 J        else inc A_i by 1! n* `- v% `- x& v  j
    end' @) f3 T5 `) V) U" o& r
end2 h3 P- M! o2 F3 F) O0 V( U( g

( |: M: Q' g( v4 r; |/ i/ j* N6 bbegin P_pick3 arriving' I. ?7 w0 A' p3 t
    set A_i to 21! R& o" R3 r. \0 s# @! c
    move into Q_induct3% o! y+ J9 {$ L5 Y; x6 i
    move into pickaisle.induct3
, Y# A  f1 `+ ?3 f: e    while A_i<=30 do begin# _# c, W4 {& m' K
        travel to pickaisle.con(A_i)6 V1 q( c( V* n  V0 I! a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) E& {3 }% |6 s% G+ ?
        else wait for 10 sec. I; A+ C8 B7 b* `" E" G" r( W
        if A_i=A_leave then send to die9 i2 i/ h, R3 ]' |% q% e
        else inc A_i by 1
3 }' T9 y, i* |& u0 G$ c    end4 D8 a+ l1 }& [. `. m8 H
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是个什么东东?
/ F' f' F" ?' }% r  m$ kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# l0 e" j: H$ G/ d5 o$ ?7 `
7 _1 q3 t/ F6 o7 E% c5 x" DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 j! k, ?. _! A3 _
& M( |5 J  M5 o* A- ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; {' j# ?/ D# s, c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' A( I# w! {9 F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ D( A& X5 X* `. f/ u% H5 C3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. e8 @7 `4 P7 a* }# M! hbegin P_induction arriving
& W! [3 b1 Z+ Q1 \    clone 1 load to P_pick(A_induct)
1 H( A+ I& i! s& t$ t; Fend最大的系5 Z8 S- G& x2 c8 ?

( I/ `6 ?* M7 L, e1 Bbegin P_pick arriving/ H; i6 z/ x; Z2 N/ V/ t
    set A_i to procindex * 10 + 1
4 |( [5 l1 {# i' T! s8 V2 z    move into Q_induct(procindex)& P: b1 J$ }% D# `  ?) ~. Y( v2 [
    move into pickaisle.induct(procindex)5 N4 S  M6 t  i7 O4 Y" j
    /*check the type of pickaisle.induct(i), for your last problem.*/- U  y5 o+ l$ s+ Y& _  H
% z  |& M3 K, o& |
    while A_i<=30 do begin7 ]: J1 l; s' Z- G& f8 M3 L
        travel to pickaisle.con(A_i)
6 @: [6 w! u$ U8 D" o* O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! E" T4 ]7 ~6 S8 S+ `        else wait for 10 sec
( J" M0 S3 @* C& `" ^        if A_i=A_leave then send to die
9 _1 T& i* T  i3 x( q' Q        else inc A_i by 1
+ x& ?- E1 M9 X  l0 {0 J    end, Y) w2 N' s) A
end! b5 j/ ^- l" h

' e6 l9 [% a6 T# s; a, A5 o$ ]其中的procindex为整形,代表当前process的序号。
0 @" j8 L( Y1 r: z" Q, n7 k4 H' Lstation和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-3-25 11:30 , Processed in 0.016639 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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